home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Scope
/
Scope Disk #058 (199x)(Scope PD)(US)[WB].zip
/
Scope Disk #058 (199x)(Scope PD)(US)[WB].adf
/
B1Subs
/
TextRace
< prev
next >
Wrap
Text File
|
1989-01-24
|
7KB
|
299 lines
WINDOW 1," ** THE GREAT AmigaBASIC TEXT RACE ** ",(0,10)-(450,170),22,-1
COLOR 2,1:CLS
PRINT ,"Loading ";CHR$(34);"graphics.bmap";CHR$(34)
'**************************************
'* You will need the following LIBRARY*
'* line plus the sub-routine of your *
'* choice. (routine numbers 1 thru 5) *
'**************************************
'**** Required ************************
CHDIR ":" :REM <-- points to ".bmap"
LIBRARY "graphics.library"
'**************************************
CLEAR,25000
ON BREAK GOSUB PickOne
BREAK ON
DEFINT A-Z
DIM Top$(9)
InFile$="J:TextRace.txt"
Top$(1)= " #1 Slowest - PRINT statement 32 color
Top$(2)= " #2 Regular WorkBench resolution PRINT
Top$(3)= " #3 Sub-Program CALLs graphics.library
Top$(4)= " #4 Using ScrollRaster 2 color
Top$(5)= " #5 In-Line CALLs top to bottom text 2 color
Top$(6)= " #6 Scroll then click for next page
Top$(7)= " #7 Top to bottom, then click for next page
Top$(8)= " #8 STOP and LIST program
Top$(9)= " #9 Leave Basic. Return to WorkBench
COLOR 2,1: CLS: PRINT " ";
COLOR 1,3
PRINT " 1 2 3 4 5 6 7 8 9 "
FOR I=0 TO 8
LINE(I*40+7,-1)-STEP(39,8),2,B
NEXT
COLOR 2,1
PRINT " Press key (#1 thru #9) or click above
PRINT "
FOR I=1 TO 9:PRINT Top$(I):NEXT
PRINT
PRINT " A collection of routines you might want to
PRINT " use for displaying text.
PRINT " The options 3 thru 7 require that the
PRINT " graphics.bmap be loaded from your disk.
PRINT " Speeds will be shown at the bottom of the screens.
PRINT
PickOne:
WINDOW CLOSE 2
SCREEN CLOSE 2
Key = 0: mKey = 0
WHILE 1
XY=MOUSE(0):X=MOUSE(1):Y=MOUSE(2)
IF XY<>0 AND Y<11 THEN mKey=INT(X*.025)+1
A$=INKEY$
IF A$>"" THEN Key=ASC(A$)-48
IF mKey>0 AND mKey<10 THEN Key=mKey
IF Key>0 AND Key<10 THEN Which
WEND
Which:
ON Key GOTO 1,2,3,4,5,6,7,StopList,Ender
'**************************************
'**************************************
'*** #1 Slowest - PRINT statement 32 color
'**************************************
1
SCREEN 2,320,200,5,1
WINDOW 2,Top$(1),(0,0)-(311,184),0,2
T&=TIMER:
OPEN InFile$ FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, GettingFile$
PRINT GettingFile$
WEND
B=LOF(1): CLOSE #1
'**************** END *****************
GOTO Meter
'**************************************
'*** #2 Regular WorkBench resolution PRINT
'**************************************
2
WINDOW 2,Top$(2),(0,2)-(631,184),0,-1
T&=TIMER:
OPEN InFile$ FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, GettingFile$
PRINT GettingFile$
WEND
B=LOF(1): CLOSE #1
'**************** END *****************
GOTO Meter
'**************************************
'*** #3 Sub-Program CALLs graphics.library
'**************************************
3
SCREEN 2,640,400,1,2
WINDOW 2,Top$(3),(0,2)-(631,210),0,2
T&=TIMER: W8&=WINDOW(8):
Botm=WINDOW(3): BotmLine=Botm-8
X&=2: Y&=Botm-3
LOCATE Botm*.125
OPEN InFile$ FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, GettingFile$
At X&,Y&
Display GettingFile$
PRINT
WEND
B=LOF(1): CLOSE #1: GOTO Meter
'*** Display and At sub-programs for #3
SUB At(X&,Y&) STATIC
CALL Move&(WINDOW(8),X&,Y&)
END SUB
SUB Display(Txt$) STATIC
CALL Text&(WINDOW(8),SADD(Txt$),LEN(Txt$))
END SUB
'**************** END *****************
'**************************************
'*** #4 Using ScrollRaster 2 color
'**************************************
4
SCREEN 2,640,400,1,2
WINDOW 2,Top$(4),(0,2)-(631,210),0,2
T&=TIMER:
W8&=WINDOW(8): Bot=27*8
Botm=WINDOW(3): BotmLine=Botm-8
OPEN InFile$ FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, GettingFile$
CALL Move&(W8&,2,BotmLine)
CALL Text&(W8&,SADD(GettingFile$),LEN(GettingFile$))
CALL ScrollRaster&(W8&,0,8,0,0,630,Botm)
WEND
B=LOF(1): CLOSE #1
'**************** END *****************
GOTO Meter
'**************************************
'*** #5 In-Line CALLs top to bottom text 2 color
'**************************************
5
SCREEN 2,640,400,1,2
WINDOW 2,Top$(5),(0,2)-(631,210),0,2
T&=TIMER: Lines&=7
W8&=WINDOW(8): Bot=27*8
Botm=WINDOW(3): BotmLine=Botm-8
OPEN InFile$ FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, GettingFile$
CALL Move&(W8&,2,Lines&)
CALL Text&(W8&,SADD(GettingFile$),LEN(GettingFile$))
CALL ClearEOL&(W8&)
Lines&=Lines&+8
IF Lines&>=Bot THEN Lines&=7
WEND
B=LOF(1): CLOSE #1
'**************** END *****************
GOTO Meter
'**************************************
'*** #6 Using ScrollRaster 2 color
'*** plus WAIT at end of page
'**************************************
6
SCREEN 2,640,400,1,2
WINDOW 2,Top$(4),(0,2)-(631,210),0,2
T&=TIMER: L=0
W8&=WINDOW(8): Bot=27*8
Botm=WINDOW(3): BotmLine=Botm-8
OPEN InFile$ FOR INPUT AS #1
WHILE NOT EOF(1)
LINE INPUT #1, GettingFile$
CALL Move&(W8&,2,BotmLine)
CALL Text&(W8&,SADD(GettingFile$),LEN(GettingFile$))
CALL ScrollRaster&(W8&,0,8,0,0,630,Botm)
L=L+1
IF L>21 THEN
L=0 :LOCATE 25,1
PRINT :PRINT ,,"Click to continue"
PRINT
XY=MOUSE(0)
WHILE MOUSE(0)=0:WEND
WHILE MOUSE(0)<>0:WEND
END IF
WEND
B=LOF(1): CLOSE #1
'**************** END *****************
GOTO Meter
'**************************************
'*** #7 In-Line CALLs top to bottom text 2 color
'*** plus WAIT at end of page
'**************************************
7
SCREEN 2,640,400,1,2
WINDOW 2,Top$(5),(0,2)-(631,210),0,2
T&=TIMER: Lines&=7
W8&=WINDOW(8): Bot=23*8
Botm=WINDOW(3): BotmLine=Botm-8
OPEN InFile$ FOR INPUT AS #1
WHILE NOT EOF(1)
LINE INPUT #1, GettingFile$
CALL Move&(W8&,2,Lines&)
CALL Text&(W8&,SADD(GettingFile$),LEN(GettingFile$))
CALL ClearEOL&(W8&)
Lines&=Lines&+8
IF Lines&>=Bot THEN
Lines&=7
'LOCATE 25,1:
PRINT
PRINT ,,"Click to continue"
XY=MOUSE(0)
WHILE MOUSE(0)=0:WEND
WHILE MOUSE(0)<>0:WEND
END IF
WEND
B=LOF(1): CLOSE #1
'**************** END *****************
Meter:
COLOR 1,0: PRINT
PRINT B;" bytes";SPACE$(80)
PRINT TIMER-T&;" seconds";SPACE$(80)
IF B>0 AND (TIMER-T&)>0 THEN
T= INT(B/(TIMER-T&))
PRINT T;" bytes per second";SPACE$(80)
END IF
PRINT " CLICK to END";SPACE$(80)
PRINT
WayCheer:
WHILE MOUSE(0)<>0: SLEEP: WEND
WHILE MOUSE(0)=0: SLEEP: WEND
WHILE MOUSE(0)<>0: SLEEP: WEND
GOTO PickOne
StopList:
LIBRARY CLOSE
CLEAR ,25000
LIST
COLOR 1,3
PRINT ," Okay? JeC 10/88 "
COLOR 2,1
PRINT
END
Ender:
LIBRARY CLOSE
CLEAR ,25000
COLOR 2,1
FOR I=1 TO 40
PRINT ," JeC 10/88 "
NEXT
SYSTEM